import 'phaser'
import backgroundImg from '../asserts/img/background.png'
import birds from '../asserts/img/birds.png'
import land from '../asserts/img/land.png'
import startButton from '../asserts/img/start_button.png'
import title from '../asserts/img/title.png'
import hero from '../asserts/img/heroPlane.png'
import bullet from '../asserts/img/bullet.png'
import enemy from '../asserts/img/enemy.png'

export default class BootScene extends Phaser.Scene {
    constructor() {
        super({
            key: 'BootScene'
        })
    }

    preload() {
        const progress = this.add.graphics();
        this.load.on('progress', (value) => {
            progress.clear();
            progress.fillStyle(0xffffff, 1);
            progress.fillRect(0, this.sys.game.config.height / 2, this.sys.game.config.width * value, 40);
        });
        this.load.on('complete', () => {
            progress.destroy();
            this.scene.start('TitleScene');
        });
        this.load.image('background', backgroundImg);
        this.load.image('birds', birds);
        this.load.image('land', land);
        this.load.image('startButton', startButton);
        this.load.image('title', title);
        this.load.image('hero', hero);
        this.load.image('bullet',bullet);
        this.load.image('enemy',enemy);
    }
}
